﻿using System;
using System.Web;
using Umbraco.Core;

namespace DAMP.PropertyEditorValueConverter
{
    public class DAMP_PropertyEditorValueConverter : Umbraco.Core.PropertyEditors.IPropertyEditorValueConverter
    {
        public bool IsConverterFor(Guid propertyEditorId, string docTypeAlias, string propertyTypeAlias)
        {
            return Guid.Parse("ef94c406-9e83-4058-a780-0375624ba7ca").Equals(propertyEditorId);
        }

        public virtual Attempt<object> ConvertPropertyValue(object value)
        {
            //Just some experimental code to show it can return a different object in MVC.
            return new Attempt<object>(true, new Model(value.ToString()));
        }
    }
}